package elements;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Spliter {

	private static final int BLOCK_SIZE = 10000;
	
	private BufferedReader br;
	
	public Spliter(String fileName) {

		try {
			br = new BufferedReader(new FileReader(fileName));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}
	
	public String getNextBlock() {
		char cbuf[] = new char[BLOCK_SIZE];
		int read = 0;
		try {
			read = br.read(cbuf, 0, BLOCK_SIZE);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (read == -1)
			return null;
		return new String(cbuf);
	}
	
}
